<template>
  <div>
    <search-form :searchFormList="searchFormList"></search-form>
    <show-table :tableHeader="tableHeader" :tableData="tableData"></show-table>
  </div>
</template>

<script>
import SearchForm from "@/components/my_com/SearchFrom";
import ShowTable from "@/components/my_com/ShowTable";
export default {
  components: { SearchForm, ShowTable },
  data() {
    return {
      searchFormList: [
        { label: "姓名", prop: "nickName", nickName: "", inp_type: "_input" },
        {
          label: "性别",
          prop: "sex",
          sex: "",
          inp_type: "_select",
          selectOption: [
            { lable: "男", value: "man" },
            { lable: "女", value: "woman" }
          ]
        },
        {
          label: "年级",
          prop: "level",
          level: "",
          inp_type: "_select",
          selectOption: [
            { lable: "高中", value: "gaozhong" },
            { lable: "本科", value: "benke" }
          ]
        },
        { label: "年龄", prop: "age", age: "", inp_type: "_input" },
        {
          label: "时间",
          prop: "time",
          time: [],
          inp_type: "_date",
          timeObj: ["startAt", "endAt"]
        }
      ],
      tableData: [
        {
          id: 1,
          nickName: "李老师",
          age: 30,
          _statusNum: "1",
          moblePhone: "18778875431",
          _statusMsg: "信息",
          email: "1031232120@qq.com"
        },
        {
          id: 2,
          nickName: "刘德华",
          age: 56,
          _statusNum: "3",
          moblePhone: "18778875434",
          _statusMsg: "警告",
          email: "103123212@qq.com"
        }
      ],
      tableHeader: [
        // { id: 'tab001', label: '序号', type: '_index' },
        { id: "tab002", label: "姓名", type: "_common", prop: "nickName" },
        { id: "tab003", label: "年龄", type: "_common", prop: "age" },
        { id: "tab004", label: "性别", type: "_status", prop: "sex" },
        {
          id: "tab005",
          label: "电话",
          type: "_common",
          prop: "moblePhone",
          width: 120
        },
        { id: "tab006", label: "邮箱", type: "_common", prop: "email" },
        {
          id: "tab007",
          label: "操作",
          type: "_operate",
          operation: [
            {
              btn_id: "bt01",
              btn_type: "编辑",
              btn_size: "small"
            },
            {
              btn_id: "bt02",
              btn_type: "详情",
              btn_size: "small"
            },
            {
              btn_id: "bt03",
              btn_type: "删除",
              btn_size: "small"
            }
          ]
        }
      ]
    };
  },
  methods: {
    getTableData(val) {
      console.log("children for me", val);
    },
    handleEdit(id) {
      console.log("a", id);
    },
    handleDetail(id) {
      console.log("b", id);
    },
    handleDel(id) {
      console.log("c", id);
    },
    handleOther(id) {
      console.log("d", id);
    }
  }
};
</script>

<style lang="scss" scoped></style>
